<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>系统管理-用户信息</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="${s.base}/js/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="${s.base}/css/base/base.css" media="all" /></head>

<body class="childrenBody">
<form class="layui-form">
	<input type="hidden" id="id" name="id" value="${sysUser.id}" />
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;登录名称</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="loginName" value="${sysUser.loginName}" placeholder="请输入登录名称" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;登录密码</label>
		<div class="layui-input-block">
			<input type="password" class="layui-input" name="password" value="${sysUser.password}" placeholder="请输入登录密码" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;用户姓名</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="userName" value="${sysUser.userName}" placeholder="请输入用户姓名" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red"></span>&nbsp;&nbsp;用户头像</label>
		<div class="layui-input-block">
			<!--单图片开始-->
			<div class="layui-input-block cy-uploadpic-ctn" id="userLogo"  style=" float:left;margin:10px 0!important;position:relative; width: 90px; height: 90px;">
			</div>
			<!--单图片结束-->
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;用户性别</label>
		<div class="layui-input-block">
			<select class="form-control" name="userSex" lay-verify="required" id="userSex"></select>
		</div>
	</div>

	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red"></span>&nbsp;&nbsp;手机号</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="userPhone" value="${sysUser.userPhone}" placeholder="请输入手机号" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;状态</label>
		<div class="layui-input-block">
			<select class="form-control" name="status" lay-verify="required" id="status"></select>
		</div>
	</div>
		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">
				<span class="red">*</span>&nbsp;&nbsp;用户类型</label>
			<div class="layui-input-block">
				<select class="form-control" name="userType" lay-verify="required" id="userType">

				</select>
			</div>
		</div>


	<div class="layui-form-item layui-row layui-col-xs12">
		<label class="layui-form-label">
			<span class="red">*</span>&nbsp;&nbsp;排序</label>
		<div class="layui-input-block">
			<input type="number" class="layui-input" name="sort" value="${sysUser.sort}" placeholder="请输入排序" lay-verify="required" autocomplete="off" /></div>
	</div>
	<div class="layui-form-item layui-row layui-col-xs12">
		<div class="layui-input-block">
			<button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="submitBtn">确定</button>
			<button type="reset" class="layui-btn layui-btn-sm layui-btn-primary cancel">取消</button></div>
	</div>
</form>
<script type="text/javascript" src="${s.base}/js/layui/layui.js"></script>
<script type="text/javascript" src="${s.base}/js/base/base.js"></script>
<script type="text/javascript">layui.use(['form', 'jquery','fileUtil','baseUtil', 'dialogUtil', 'pageUtil'],
    function() {
        var form = layui.form,
            fileUtil = layui.fileUtil,
            dialogUtil = layui.dialogUtil,
            $ = layui.jquery,
            baseUtil = layui.baseUtil,
            pageUtil = layui.pageUtil;

        $("#departName").bind('click',function () {
            dialogUtil.popUpSingleSelect("部门选择器","/sysDepart/dTreeList",function(id,name,layer,index){
                $("#departId").val(id);
                $("#departName").val(name);
            });
        });
        var userType="${currentUser.userType}";
        //单图片上传
        fileUtil.uploadImageNoSave('userLogo',"sys/user","${sysUser.userLogo}");
        var values="";
        if(userType=="2"){
            values="3,4";
		}else{
            values="4";
        }
        var dictResData="";
        pageUtil.initDictByValues("base_user_type",values,
            function(dictResultData) {
                dictResData=dictResultData;
                pageUtil.initDict("base_status,base_sex,base_user_type",
                    function (dictData) {
                        pageUtil.showDict($("#userType"), pageUtil.aceeptDictContentList(dictResultData, "base_user_type"), "", '${sysUser.userType}');
                        pageUtil.showDict($("#userSex"), pageUtil.aceeptDictContentList(dictData, "base_sex"), "", '${sysUser.userSex}');
                        pageUtil.showDict($("#status"), pageUtil.aceeptDictContentList(dictData, "base_status"), "", '${sysUser.status}');
                    });
            });
        form.on('submit(submitBtn)',
            function(data) {
                data.field.roleName=pageUtil.aceeptDictContentName(dictResData, "base_user_type",data.field.userType);
                data.field.departName=pageUtil.aceeptDictContentName(dictResData, "base_user_type",data.field.userType);
                baseUtil.postMethodResult("/sysUser/addShare", data.field,
                    function(result) {
                        parent.location.reload();
                    });
                return false;
            });
    });</script>
</body>

</html>